From 15a56f386ae0540127aa80c51429e5165e925589 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 13 Feb 2021 16:46:57 +0000 Subject: [PATCH] d/rules: Dump reftest differences into the log as base64 Some of the reftests are failing reliably on buildds, but passing reliably on the corresponding porterbox. We should inspect the differences to check that they're close enough. Debian package builds don't have an equivalent of $AUTOPKGTEST_ARTIFACTS (as requested in https://bugs.launchpad.net/launchpad/+bug/1845159) so base64-encoding the results and dumping them into the text log is the best we can do right now. --- debian/log-reftests.py | 28 ++++++++++++++++++++++++++++ debian/rules | 1 + 2 files changed, 29 insertions(+) create mode 100755 debian/log-reftests.py diff --git a/debian/log-reftests.py b/debian/log-reftests.py new file mode 100755 index 0000000000..51c5b0f26a --- /dev/null +++ b/debian/log-reftests.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 +# Copyright 2021 Simon McVittie +# SPDX-License-Identifier: CC0-1.0 + +import base64 +import sys +from pathlib import Path + +if __name__ == '__main__': + for ui in Path('testsuite', 'reftests').glob('*.ui'): + for outputs in ( + Path('debian', 'build', 'deb', 'testsuite', 'reftests', 'output', 'x11'), + ): + diff = (outputs / (ui.stem + '.diff.png')) + + if diff.exists(): + ref = (outputs / (ui.stem + '.ref.png')) + out = (outputs / (ui.stem + '.out.png')) + + for path in (ref, out, diff): + print('begin-base64 644 %s' % path) + sys.stdout.flush() + with open(path, 'rb') as reader: + base64.encode(reader, sys.stdout.buffer) + print('====') + print('') + + print('') diff --git a/debian/rules b/debian/rules index 4fdf448233..f93bc39bb0 100755 --- a/debian/rules +++ b/debian/rules @@ -249,6 +249,7 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) --timeout-multiplier $(test_timeout_multiplier) \ || touch debian/tests-failed tail -v -n +0 debian/build/deb/meson-logs/testlog-x11.txt + debian/log-reftests.py if test -e debian/tests-failed; then exit 1; fi endif -- 2.30.2